from PyQt5.QtWidgets import QApplication,QWidget,QLabel,QLineEdit,QTextEdit,QGridLayout
import sys

class Window(QWidget):

    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):
        # 创建表格布局
        grid = QGridLayout()
        self.setLayout(grid)

        
        title = QLabel('标题')
        # 创建行编辑器
        title_edit = QLineEdit()

        content = QLabel('内容')
        # 创建文本编辑器
        content_edit = QTextEdit()

        grid.addWidget(title,1,1)
        grid.addWidget(title_edit,1,2)
        grid.addWidget(content,2,1)
        grid.addWidget(content_edit,2,2)

        self.setGeometry(1000,300,300,200)
        self.setWindowTitle('文本输入框')
        self.show()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    w = Window()
    app.exec()